# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>

_realname=pyqt6-sip
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=13.1.0
pkgrel=1
pkgdesc="The sip module support for PyQt6 (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('GPL')
url="https://riverbankcomputing.com/software/pyqt"
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=(https://pypi.python.org/packages/source/P/PyQt6_sip/PyQt6_sip-${pkgver}.tar.gz)
sha256sums=('7c31073fe8e6cb8a42e85d60d3a096700a9047c772b354d6227dfe965566ec8a')

prepare() {
  cd "${srcdir}"
  rm -rf python-build-${MSYSTEM} | true
  cp -r "PyQt6_sip-${pkgver}" "python-build-${MSYSTEM}"
}

build() {
  cd python-build-${MSYSTEM}
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py build
}

package(){
  cd "${srcdir}"/python-build-${MSYSTEM}
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \
    --root="${pkgdir}" --optimize=1 --skip-build
}
